{# Set, replace or remove one stored secret (dialog body). The field is never filled: a value goes in, nothing comes back out. A 422 re-renders it with ``errors``. Provider config shown in the clear offers what the provider lists (``choices``) through a datalist, and still takes typing; a setting with a closed set of values is a select instead. #} {% from "components/macros/layout.html" import dialog_title %} {% from "components/macros/form.html" import field, password_input, primary_button, action, select %} {% from "components/macros/feedback.html" import error_banner %} {{ dialog_title(row.name, row.owner ~ (" · " ~ row.label if row.label else "")) }}
{{ error_banner(errors) }} {% if row.setting %}

Default {{ row.default or "none" }}. A saved value applies when the app restarts; Remove goes back to the default.

{% endif %} {% if row.hint %}

Now {{ ("•••• " ~ row.hint) if row.secret else row.hint }}{% if row.set_by %}, set by {{ row.set_by }}{% endif %}. Saving replaces it.

{% endif %} {% call field("Value") %}
{% if picks %}{{ select("value", picks, row.in_effect, blank=None, block=True) }}{% elif row.secret %}{{ password_input("value", autocomplete="off", placeholder="Paste the new value") }}{% else %}{% if choices %}{% for value, label in choices %}{% endfor %}{% endif %}{% endif %}
{% endcall %}
{{ primary_button("Save", "submit") }} {% if stored %}{{ action("Remove", hx_dialog_post(url ~ "/remove"), "danger") }}{% endif %}